{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
  <title>生成试卷</title>
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" href="../../favicon.ico">
  <!-- Bootstrap 核心CSS文件 -->
  <link href="{% static 'login/css/bootstrap.min.css' %}" rel="stylesheet">
  <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
  <!-- Custom styles for this template -->
  <link href="justified-nav.css" rel="stylesheet">
  <style type="text/css">
      body{
        background: url("{% static 'login/image/121.jpg' %}") repeat-y;
        background-color: white;
        color: #337ab7;
        }
        /*.form-signin{background: rgba(255,255,255,0);width:320px;margin:120px auto;}*/
        /*阴影*/
        .fa{display: inline-block;top: 27px;left: 6px;position: relative;color: #ccc;}
        input[type="text"],input[type="password"]{padding-left:26px;}
        #checkbox{padding-left:21px;}
        
        .form-signin-heading{
            text-align: center;
            color: #337ab7;
        }
        .tabbable{
            background: rgba(255,255,255,0.7);
        }
        .footer{      
            position: fixed;
            left: 460px;
            bottom: 6px;
        }
  </style>
</head>
<body>
  <div class="container">
    
    <div class="row">
     
      <div class="col-md-2">
      </div>    
      
      <div class="col-md-8 login_box">

        <div class="masthead">
          <h2 class="form-signin-heading">北京网络职业学院考试系统</h2>
          <h3 class="form-signin-heading">请选择试卷或生成新的试卷</h3>
        </div> 
        
        <div class="tabbable" id="tabs-142726">
          <ul class="nav nav-tabs">
            <li class="active">
              <a href="#panel-666" data-toggle="tab" contenteditable="false" class="glyphicon glyphicon-expand">查看已生成的试卷
              </a>
            </li>
            <li class="">
              <a href="#panel-888" data-toggle="tab" contenteditable="false" class="glyphicon glyphicon-circle-arrow-right">生成新的试卷
              </a>
            </li>
            <li class="pull-right">
              <a href="{% url 'login:login' %}" class="glyphicon glyphicon-user">返回登录界面
              </a>
            </li>
            <li class="pull-right">
              <a href="{% url 'paper:batch' %}" data-toggle="tab" contenteditable="false" class="pull-right glyphicon glyphicon-pencil">点击前往批卷页面 
              </a>
            </li>
                        
          </ul>
        <div class="tab-content">
          <div class="tab-pane active" id="panel-666">
            <div class="tabbable" id="tabs-142739">
              <div class="box box-element ui-draggable" style="display: block;">
                <i class="fa fa-user fa-lg"></i>
                <h4 class="glyphicon glyphicon-leaf">点击试卷名字查看试卷详细内容</h4>
                <div class="view">
                  <div class="panel-group" id="panel-307253">
                    {% for paper,info in paper_dict.items %}
                    <div class="panel panel-default">
                      <div class="panel-heading">
                        <a class="panel-title collapsed" data-toggle="collapse" data-parent="#panel-307253" href="#{{forloop.counter}}" contenteditable="false">{{paper}}</a>
                      </div>  
                      <div id="{{forloop.counter}}" class="panel-collapse collapse" style="height: auto;">
                        <div class="panel-body" contenteditable="false">
                            {% if info.单选题 %}
                                          <!--这里放置单选题面板-->
                                          <div class="panel panel-primary">
                                            <div class="panel-heading">
                                              <h3 class="panel-title"> 单选题(单题分值:{{info.单选题.1}})</h3>
                                            </div>
                                            <div class="panel-body">
                                              {% for question in info.单选题.2 %}
                                              <h3>{{forloop.counter}}、{{question.question_text}}</h3>
                                              <ol type="A">
                                              {% for choice in question.choice_set.all %}
                                                <li>
                                                   {{choice.choice_text}} 
                                                </li>
                                              {% endfor %}
                                              </ol>
                                            {% endfor %}
                                          </div>    
                                        </div>
                                        <!--/单选题面板结束-->
                                        {%endif%}
                                        
                                        {% if info.多选题 %}
                                        <!--多选题面板-->
                                        <div class="panel panel-success">
                                            <div class="panel-heading">
                                              <h3 class="panel-title"> 多选题(单题分值:{{info.多选题.1}})</h3>
                                            </div>
                                            <div class="panel-body">
                                              <h3>这里放置题干，直接更改文字即可</h3>
                                              <div class="checkbox">
                                                <label>
                                                  <input type="checkbox" value="">
                                                  A.这里放置选项文字，直接更改即可。
                                                </label>
                                            </div>
                                            <div class="checkbox">
                                                <label>
                                                  <input type="checkbox" value="">
                                                  B.这里放置选项文字，直接更改即可。
                                                </label>
                                            </div>  
                                        </div>
                                        {% endif %}
                                        <!--/多选题面板结束-->

                                        <!--填空题面板部分-->
                                        {% if info.填空题 %}
                                        <div class="panel panel-info">
                                            <div class="panel-heading">
                                              <h3 class="panel-title"> 填空题(单题分值:{{info.填空题.1}})</h3>
                                            </div>
                                            <div class="panel-body table-responsive">
                                              <table class="table table-hover">
                                                {% for question in info.填空题.2 %}
                                                <tr>
                                                  <td>{{forloop.counter}}、{{question.question_text}}</td>
                                                  {% endfor %}
                                                </tr>
                                              </table>
                                            </div>
                                        </div>
                                        {% endif %}
                                        <!--/填空题面板结束-->
                                        <!--判断题面板开始-->
                                        {% if info.判断题 %}
                                        <div class="panel panel-warning">
                                            <div class="panel-heading">
                                              <h3 class="panel-title"> 判断题(单题分值:{{info.判断题.1}})</h3>
                                            </div>
                                            <div class="panel-body">
                                              {% for question in info.判断题.2 %}
                                              <div class="row">
                                                
                                                <div class="col-sm-12">
                                                  <p>{{forloop.counter}}、{{question.question_text}}</p>         
                                                </div>  
                                              </div>
                                              {% endfor %}    
                                            </div>
                                        </div>
                                        {% endif %}
                                        <!--/判断题面板结束-->
                                        <!--简答题面板-->
                                        {% if info.简答题 %}
                                          <div class="panel panel-danger">
                                            <div class="panel-heading">
                                              <h3 class="panel-title"> 简答题(单题分值:{{info.简答题.1}})</h3>
                                            </div>
                                            <div class="panel-body">
                                              {% for question in info.简答题.2 %}
                                              <div class="row">
                                                <div class="col-sm-10 col-sm-offset-1">
                                                  <h3>{{forloop.counter}}、{{question.question_text}}</h3>
                                                </div>      
                                              </div>
                                              {% endfor %}
                                            </div>
                                        
                                        </div>
                                        {% endif %}
                                        <!--/简答题面板结束-->

                      </div>

                      </div>

                    </div>
                  {% endfor %}
                  </div>

                </div>

              </div>

            </div>

          </div>
          <div class="tab-pane" id="panel-888">
              <i class="fa fa-user fa-lg"></i>
               <div class="tabbable" id="tabs-142713">
                  <ul class="nav nav-tabs">
                    {% for question_obj in type_dict %} 
                    {% if forloop.counter == 1 %}
                    <li class="active">
                    {% else %}
                    <li class="">
                    {% endif %}
                    <a href="#{{forloop.counter}}" data-toggle="tab" contenteditable="false">{{question_obj.question_type}}
                    </a>             
                    </li>
                    {% endfor %}
                  </ul>
                <form class="form-signin" action="{% url 'paper:index_yunsuan' %}" method="post">
                  {% csrf_token %}
                <div class="tab-content">
                  {% for question_obj,question_num in type_dict.items %}
                    {% if forloop.counter == 1 %}
                    <div class="tab-pane active" id="{{forloop.counter}}">
                    {% else %}
                    <div class="tab-pane" id="{{forloop.counter}}">
                    {% endif %}                                  
                    <h4>温馨提示：题库共有 {{question_num}} 道此题型</h4>
                    <i class="fa fa-user fa-lg"></i>
                    <label for="inputNum">请输入要出几道题：</label>
                    <input type="text" name="{{question_obj.question_type}}" id="inputNum" class="form-control" placeholder="题数" required autofocus>
                    <i class="fa fa-lock fa-lg"></i>
                    <label for="inputScore">请输入该题型分值：</label>
                    <input type="text" name="{{question_obj.question_type}}" id="inputScore" class="form-control" placeholder="分数" required>
                    </div> 
                  {% endfor %}
                  <i class="fa fa-user fa-lg"></i>    
                  <label for="paper_name">请输入您的试卷名：</label>
                  <input type="text" name="paper_name" id="paper_name" class="form-control" placeholder="试卷名字只需输入一次即可">
                  <i class="fa fa-user fa-lg"></i>
                  <button class="btn btn-lg btn-primary btn-block" type="submit">点击生成试卷</button>
                </form>




                </div>

               </div>

          </div>

        </div>

        </div>
      
      </div>
      <div class="col-md-2">
      </div> 


    </div>
  <footer class="footer">
  <p>&copy; 2018 北京网络职业学院考试系统Company, Inc.</p>
  </footer>

  </div>  

</body>
</html>